from request import item,fetch,Case


a = item('登陆',  fetch("https://paytest.ciicsh.com/auth/authenticate/login", {
    "headers": {
        "accept": "application/json, text/plain, */*",
        "accept-language": "zh-CN,zh;q=0.9",
        "content-type": "application/json;charset=UTF-8",
        "sec-fetch-dest": "empty",
        "sec-fetch-mode": "cors",
        "sec-fetch-site": "same-origin"
    },
    "referrer": "https://paytest.ciicsh.com/login?redirect=%2Fdashboard",
    "referrerPolicy": "no-referrer-when-downgrade",
    "body": "{\"userId\":\"13800510000\",\"password\":\"AAAaaa111\"}",
    "method": "POST",
    "mode": "cors",
    "credentials": "omit"
})).expect('data.code').toBe(0).save('data.token', 'token').save('data.data.menuList.1','mjn')

b=item('人员',fetch("https://paytest.ciicsh.com/business/employee/list", {
  "headers": {
    "accept": "application/json, text/plain, */*",
    "accept-language": "zh-CN,zh;q=0.9",
    "content-type": "application/json;charset=UTF-8",
    "sec-fetch-dest": "empty",
    "sec-fetch-mode": "cors",
    "sec-fetch-site": "same-origin",
    "signstr": "77b71467437828ec3bc3c2c1bdf0b057",
    "tenant_id": "tenant_021139",
    "timestamp": "1596090103049",
    "token": "${token1}"
  },
  "referrer": "https://paytest.ciicsh.com/employee/list",
  "referrerPolicy": "no-referrer-when-downgrade",
  "body": "${mjn}",
  "method": "POST",
  "mode": "cors",
  "credentials": "include"
}))

c=Case('test',a,b).run()
print(c.res)
print(c.step)
